﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace _036
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string str = "C#教程 C语言中文网 c.biancheng.net正则表达式";
            showMatch(str, @"\bC\S*");
            Console.ReadKey();
        }
        private static void showMatch(string text,string expr)
        {
            Console.WriteLine("正则表达式为："+expr);
            Console.WriteLine("匹配以C开头的字符串");
            MatchCollection mc = Regex.Matches(text, expr);
            foreach (Match m in mc)
            {
                Console.WriteLine(m);
            }
        }
    }
}
